import com.sun.deploy.cache.BaseLocalApplicationProperties;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.SimpleTimeZone;

public class Test {
    public static void main(String[] args) {
        LocalDateTime date1 = LocalDateTime.now();
        System.out.println(date1.plusDays(67).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        System.out.println(date1.plusDays(73).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));

        //用Carlendar类直接获取当前是第几天
        Calendar calendar = Calendar.getInstance();
        int day = calendar.get(Calendar.DAY_OF_YEAR);
        System.out.println("这是今年的第" + day + "天");

        //之后使用另一个类来完成日期加减
        LocalDate my = LocalDate.of(2003,8,16);
        LocalDate you = LocalDate.of(2002,12,17);
        long days = my.until(you).getDays();
        System.out.println("我们生日相差" + days + "天");
    }
}
